package com.charlotte.study.gupao.prototype.deep.serialize;



import java.util.ArrayList;
import java.util.List;

/**
 * @author junjie.ding
 * @date 2020/3/2
 */
public class main {
    public static void main(String[] args) {
        ConcretePrototype prototype = new ConcretePrototype();
        prototype.setName("zhangsan");
        prototype.setAge(18);

        List<String> hobbies = new ArrayList<String>();
        hobbies.add("书法");
        hobbies.add("game");
        prototype.setHobbies(hobbies);


        System.out.println(prototype);


        ConcretePrototype deepCopy = prototype.deepCopy();
        System.out.println(deepCopy);

        deepCopy.getHobbies().add("电脑游戏");

        System.out.println(prototype);
        System.out.println(deepCopy);
    }
}
